<template>
    <div class="cvu-backtop">
        <BackTop
            :height="height"
            :bottom="bottom"
            :right="right"
            :duration="duration"
            @on-click="handleClick"
        ></BackTop>
    </div>
</template>
<script>
export default {
    name: 'cvu-back-top',
    props: {
        // 页面滚动高度达到该值时才显示BackTop组件
        height: {
            type: Number,
            default: 400
        },
        // 组件距离底部的距离
        bottom: {
            type: Number,
            default: 30
        },
        // 组件距离右部的距离
        right: {
            type: Number,
            default: 30
        },
        // 滚动动画持续时间，单位 毫秒
        duration: {
            type: Number,
            default: 1000
        }
    },
    methods: {
        // 点击监听
        handleClick() {
            this.$emit('on-click')
        }
    }
}
</script>
<style lang="scss" scoped>
    @import '../../../style/_index.scss';
</style>